package taskadvanced.core.rtm;



public class Parameter implements Comparable<Parameter> {
	private String key;
	private String value;
	
	public Parameter(String key, String value){
		this.key = key;
		this.value = value;
	}
	
	public String getKey(){
		return key;
	}
	
	public String getValue(){
		return value;
	}
	
	public void setKey(String key){
		this.key = key;
	}
	
	public void setValue(String value){
		this.value = value;
	}
	
	@Override 
	public boolean equals(Object another){
		if (this == another)
			return true;
		
		if (!(another instanceof Parameter))
			return false;
		
		Parameter anotherParam = (Parameter)another;
		
		return 	( key.equalsIgnoreCase(anotherParam.getKey()) );
	}

	@Override
	public int compareTo(Parameter another) {
		if (this.equals(another))
			return 0;
		return key.compareToIgnoreCase(another.getKey());
	}
	
	@Override
	public String toString(){
		return key.toLowerCase() + value;
	}
}

